﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Administrator/MasterPage.master" AutoEventWireup="false" CodeFile="frmHistoryPurge.aspx.vb" Inherits="Administrator_frmHistoryPurge" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <script type="text/javascript">

            $(document).ready(function () {

                Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                    yearAddToDisplay: 543,
                    dateFormat: 'dd/mm/yy',
                    showOn: "button",
                    buttonImage: "../img/calendar.gif",
                    buttonImageOnly: true
                }));
                $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                    yearAddToDisplay: 543,
                    dateFormat: 'dd/mm/yy',
                    showOn: "button",
                    buttonImage: "../img/calendar.gif",
                    buttonImageOnly: true
                }));
                function EndRequestHandler(sender, args) {
                    $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                        yearAddToDisplay: 543,
                        dateFormat: 'dd/mm/yy',
                        showOn: "button",
                        buttonImage: "../img/calendar.gif",
                        buttonImageOnly: true
                    }));
                    $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                        yearAddToDisplay: 543,
                        dateFormat: 'dd/mm/yy',
                        showOn: "button",
                        buttonImage: "../img/calendar.gif",
                        buttonImageOnly: true
                    }));

                }

            });
    </script>
            <table style="width:100%;">
                <tr>
                    <td style="text-align: right"  >
                        ชื่อ Log :</td>
                    <td style="text-align: left" >
                        <asp:DropDownList ID="ddlTableLog" runat="server" Height="26px" Width="218px" 
                            AutoPostBack="True" CssClass="control">
                            <asp:ListItem Value="-1">*** กรุณาเลือก ***</asp:ListItem>
                            <asp:ListItem Value="0">ประวัติการเข้าใช้ระบบ</asp:ListItem>
                            <asp:ListItem Value="1">ประวัติการเข้าใช้โปรแกรม</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right">
                        ชื่อไฟล์ :</td>
                    <td align="left">
                        <asp:DropDownList ID="ddlFileName" runat="server" Height="20px" Width="294px" 
                            AutoPostBack="True" CssClass="control">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right">
                        &nbsp;</td>
                    <td align="left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        รหัสผู้ใช้งาน : </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtUserName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" style="margin-bottom: 0px" Width="200px"></asp:TextBox>
                    </td>
                    <td style="text-align: right">
                        &nbsp;</td>
                    <td align="left">
                        &nbsp;</td>
                    <td style="text-align: right">
                        &nbsp;</td>
                    <td align="left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        วันที่ :</td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtStartDate" runat="server" AutoCompleteType="Disabled" 
                            Height="20px" Width="183px"></asp:TextBox>
                    </td>
                    <td style="text-align: right">
                        ถึง</td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtEndDate" runat="server" AutoCompleteType="Disabled" 
                            Height="20px" Width="180px"></asp:TextBox>
                    </td>
                    <td style="text-align: right">
                        &nbsp;</td>
                    <td style="text-align: left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td colspan="6" style="text-align: right">
                        <asp:Button ID="btnSearch" runat="server" CssClass="control" Text="ค้นหา" 
                            Width="80px" />
                    </td>
                </tr>
            </table>
            <div align="center">
                <asp:Label ID="lblMsg" runat="server" CssClass="control" Font-Size="XX-Large" 
                            ForeColor="Red" Height="30px" Visible="False"></asp:Label>
                <asp:GridView ID="gvLogTran" runat="server" AllowSorting="True" 
                            AutoGenerateColumns="False" CellPadding="4" CssClass="control" 
                            ForeColor="#333333" Width="100%" AllowPaging="True">
                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    <Columns>
                        <asp:BoundField DataField="uniqueid" HeaderText="รหัส" ReadOnly="True" 
                                    SortExpression="uniqueid">
                        <ItemStyle HorizontalAlign="Left" Width="120px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="UpdateBy" HeaderText="รหัสผู้ใช้งาน" 
                                    SortExpression="UpdateBy">
                        <ItemStyle HorizontalAlign="Left" Width="110px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TranType" HeaderText="ประเภท" 
                                    SortExpression="TranType">
                        <ItemStyle Width="100px" HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Description" 
                                    HeaderText="รายละเอียด" SortExpression="Description">
                        <ItemStyle HorizontalAlign="Left" />
                        </asp:BoundField>
                        <asp:BoundField DataField="LogDate" HeaderText="วันที่ทำรายการ" ReadOnly="True" 
                                    SortExpression="LogDate">
                        <ItemStyle Width="140px" HorizontalAlign="Left" />
                        </asp:BoundField>
                    </Columns>
                    <FooterStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                    <RowStyle ForeColor="#333333" />
                    <PagerSettings Mode="NumericFirstLast" />
                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" 
                    CssClass="cssPager" />
                    <SelectedRowStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="Navy" />
                    <HeaderStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </div>
      
          <div>
          
              <asp:GridView ID="gvLogLogin" runat="server" AllowPaging="True" 
                  AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
                  CssClass="control" ForeColor="#333333" Width="100%">
                  <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                  <FooterStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                  <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                  <PagerSettings Mode="NumericFirstLast" />
                  <PagerStyle BackColor="#FFCC66" CssClass="cssPager" ForeColor="#333333" 
                      HorizontalAlign="Center" />
                  <SelectedRowStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="Navy" />
                  <HeaderStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                  <AlternatingRowStyle BackColor="White" />
                  <Columns>
                      <asp:BoundField DataField="userName" HeaderText="รหัสผู้ใช้งาน" ReadOnly="True" 
                          SortExpression="userName">
                      <ItemStyle HorizontalAlign="Left" Width="100px" />
                      </asp:BoundField>
                      <asp:TemplateField HeaderText="ชื่อ-นามสกุล">
                          <ItemTemplate>
                              <asp:Label ID="Label1" runat="server" 
                                  Text='<%# eval("EmpName") & " " & eval("EmpLastName") %>'></asp:Label>
                          </ItemTemplate>
                          <ItemStyle HorizontalAlign="Left" Width="150px" />
                      </asp:TemplateField>
                      <asp:BoundField DataField="LoginType" HeaderText="ประเภท" ReadOnly="True" 
                          SortExpression="LoginType">
                      <ItemStyle HorizontalAlign="Left" Width="120px" />
                      </asp:BoundField>
                      <asp:BoundField DataField="LoginDate" HeaderText="วันที่" 
                          SortExpression="LoginDate">
                      <ItemStyle HorizontalAlign="Left" Width="150px" />
                      </asp:BoundField>
                      <asp:BoundField DataField="LastIP" HeaderText="IP เข้าใช้งาน">
                      <ItemStyle HorizontalAlign="Left" />
                      </asp:BoundField>
                      <asp:BoundField DataField="DeptName" HeaderText="ฝ่าย" />
                      <asp:BoundField DataField="BranchName" HeaderText="ส่วนงาน/สาขา" />
                  </Columns>
              </asp:GridView>
          
          </div>

          
            <div align=right>
            
                <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
            
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

